package homework;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/*利用字节流将E盘下的a.png图片复制到D盘下(文件名保存一致)*/
public class Demo4 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("E:\\a.png");
        FileOutputStream fos = new FileOutputStream("D:\\a.png");

        int len;
        while ((len=fis.read())!=-1){
            fos.write(len);
        }
        fis.close();
        fos.close();
    }
}
